package com.example.demo.dao.dxy;

import com.example.demo.entity.User;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper

@Repository //Dao层的注解
public interface IHomeDao{
    @Select("select * from user")
    public List<User> findHomeAll();
    @Insert("INSERT INTO user(id,username,password,birthday,photo,introduce,usertype) VALUES(#{id},#{username},#{password},#{birthday},#{photo},#{introduce},#{usertype})")
    public int addHomeInfo(@Param("id") String id,@Param("username") String username,@Param("password") String password,@Param("birthday") String birthday,@Param("photo") String photo,@Param("introduce") String introduce,@Param("usertype") String usertype);
    @Delete("DELETE FROM user WHERE id=#{id}")
    public int deleteHomeInfo(@Param("id") String id);
    @Update("UPDATE user SET username=#{username},password=#{password},birthday=#{birthday},photo=#{photo},introduce=#{introduce},usertype=#{usertype} WHERE id=#{id}")
    public int updeteHomeInfo(@Param("id") String id,@Param("username") String username,@Param("password") String password,@Param("birthday") String birthday,@Param("photo") String photo,@Param("introduce") String introduce,@Param("usertype") String usertype);

}

